
#include "CouetteFlowProblem.h"

template<>
InputParameters validParams<CouetteFlowProblem>()
{
  InputParameters params = validParams<NavierStokesProblem>();

  return params;
}

CouetteFlowProblem::CouetteFlowProblem(const InputParameters &params) :
	NavierStokesProblem(params)
{
}

void CouetteFlowProblem::valueExact(Real *value, Real t, const Point &p)
{
	Real x = p(0);
	Real y = p(1);
	Real z = p(2);

	Real T2=0.85,T1=0.8;
	Real tem = T1 + ( T2 - T1 ) * y / 2 + 0.5 * _prandtl * (_gamma - 1) * _mach * _mach * y / 2 * ( 1 - y / 2 );
	Real pre = 1./(_gamma * _mach * _mach);
	Real density = pre * _gamma * _mach * _mach/tem;
	Real u = p(1)/2.0, v =0, w = 0;
	RealVectorValue mom(density*u, density*v, density*w);
	Real rhoe = pre/(_gamma-1)+0.5*density*(u*u + v*v + w*w);

	value[0] = density;
	value[1] = mom(0);
	value[2] = mom(1);
	value[3] = mom(2);
	value[4] = rhoe;
}

void CouetteFlowProblem::boundaryCondition(Real *value, Real t, const Point &p)
{
	valueExact(value, t, p);
}
